Carbon


FSGetVolumeInfo

Header: Files.h Carbon status: Supported

Returns information about a volume as a whole.

OSErr FSGetVolumeInfo (
    FSVolumeRefNum volume, 
    ItemCount volumeIndex, 
    FSVolumeRefNum *actualVolume, 
    FSVolumeInfoBitmap whichInfo, 
    FSVolumeInfo *info, 
    HFSUniStr255 *volumeName, 
    FSRef *rootDirectory
);
volume

The volume whose information is to be returned, if volumeIndex is 0.

volumeIndex

The index of the desired volume, or 0 to use the volume reference number in volume.

actualVolume

On return, the volume reference number of the volume. This is useful when indexing over all mounted volumes. If you don’t want this information (because you supplied a particular volume reference number in volume, for example), set actualVolume to NULL.

whichInfo

Specifies which volume info fields to get and return in the info parameter. If you don’t want the information about the volume returned in the info parameter, set whichInfo to kFSVolInfoNone. See also FSVolumeInfo.

info

On return, the values of the volume info fields. If you don’t want this output, set this parameter to NULL.

volumeName

On return, the Unicode name. If you don’t wish to retrieve this information, set to NULL.

rootDirectory

On return, the FSRef for the volume’s root directory. If you don’t wish to retrieve this information, set to NULL.

function result

A result code.

DISCUSSION

You can specify a particular volume or index through the list of mounted volumes. To get information on a particular volume, set volume to the desired FSVolumeRefNum and set volumeIndex to zero. To index through the list of mounted volumes, set volume to kFSInvalidVolumeRefNum and set volumeIndex to the index (starting at 1).

To get information about the root directory of a volume, you can use FSGetCatalogInfo.

AVAILABILITY

Supported in Carbon. Available in Mac OS 9, and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)